package com.example.demo_yunpan.service;

import com.example.demo_yunpan.entity.folder;
import org.springframework.stereotype.Service;
import org.apache.hadoop.fs.FileStatus;

import java.io.IOException;
import java.util.List;

@Service
public interface FolderService {

    /**
     * 根据userId查询第一级文件夹
     * @Param userId,path
     * return list
     * */
    List<folder> findFolderByuserId(String userId,String path);

    /**
     * 查询同一个用户Id的所有文件夹
     * @param userId,fileNameFuzzy,category
     * return List
     * */
    List<folder> findAllByuserId(String userId,String fileNameFuzzy,String category);

    /**
     * folderId查询文件夹
     * @param folderId
     * return 查询结果
     * */
    FileStatus selectFolderByFolderId(String folderId) throws IOException;

    /**
     * 返回上一级文件夹
     * @param folderId
     * return 查询结果
     * */
    folder getParentFolderById(String folderId);

    /**
     * 新建文件夹
     * @param folder
     * return 插入结果
     * */
    boolean createFolder(folder folder) throws Exception;

    /**
     * 删除文件夹
     * @param foldeId
     * */
    public boolean deleteFolder(String foldeId) throws Exception;

    /**
     * 重命名文件夹
     * @param oldName,newName
     * */
    public folder renameFolder(String oldName, String newName,String folderId) throws Exception;

    /**
     * 移动文件夹
     * @param folderId,lastFolder
     * */
    public folder moveFolder(String folderId, String lastFolder)throws Exception;
}
